#!/data/data/com.termux/files/usr/bin/bash

pkg i git zsh -y

if [ ! -d "$HOME/.termux" ]; then
  mkdir -p "$HOME/.termux"
fi
cd "$HOME/.termux"

git clone https://gitee.com/rvvcim/termux-ohmyzsh.git gittmp --depth 1
rm -rf ./gittmp/{.git,install.sh,README.md}
mv ./gittmp/* .
rm -rf gittmp

cp "$HOME/.termux/zshplugin/oh-my-zsh/templates/zshrc.zsh-template" "$HOME/.zshrc"
sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="agnoster"/g' "$HOME/.zshrc"
echo "source $HOME/.termux/zshplugin/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> "$HOME/.zshrc"
chmod u+x "$HOME/.termux/zshplugin/zsht.sh"
echo "alias zsht='$HOME/.termux/zshplugin/zsht.sh'" >> "$HOME/.zshrc"

chsh -s zsh

termux-reload-settings

echo -e "ohmyzsh已安装完成\n请重启Termux后输入:  zsht  调整字体及配色"

exit
